home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 388 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  46 lines

  1. Newsgroups: comp.lang.c++
  2. Path: telepost.no!statoil!usenet
  3. From: Bjorn Thomassen <konbot@ST.Statoil.notes.telemax>
  4. Subject: Re: Using BC4.5 TArrayAsVector of my class in a class!
  5. Content-Type: text/plain; charset=us-ascii
  6. Message-ID: <1996Jan4.085404.7801@statoil.no>
  7. Sender: usenet@statoil.no
  8. Nntp-Posting-Host: 143.97.108.156
  9. Content-Transfer-Encoding: 7bit
  10. Organization: Delfi Data AS
  11. References: <DKMHJE.B0B@westminster.ac.uk>
  12. Mime-Version: 1.0
  13. Date: Thu, 4 Jan 1996 08:54:04 GMT
  14. X-Mailer: Mozilla 1.1NOV (Windows; I; 16bit)
  15.  
  16. An instance of TSArrayAsVector needs at least one argument (upper) to be 
  17. constructed. To make it dynamical, you need to provide 
  18. all three arguments: upper, lower, delta :
  19.  
  20.  
  21.              /* Change here*/
  22. Pack::Pack() : pack(52)
  23. {
  24.         Card card;
  25.         SUIT suit;
  26.         RANK rank;
  27.  
  28.         NumberOfCards=0;
  29.  
  30.         for(suit=clubs;suit<=spades;suit++)
  31.                 for(rank=two;rank<=ace;rank++)
  32.                         {
  33.                                 card.SetSuit(suit);
  34.                                 card.SetRank(rank);
  35.                                 card.SetFace(down);
  36.                                 AddCard(card);
  37.                                 NumberOfCards++;
  38.                         }
  39. }
  40.  
  41.  
  42.  
  43. As you can see, just add ': pack(52)' at the end of the function definition header.
  44.  
  45.  
  46.